#ifndef CORE_BOX_PRIMITIVE_SAMPLE_H
#define CORE_BOX_PRIMITIVE_SAMPLE_H

#include "SampleBase.h"
#include "Types.h"
#include "Sphere.h"
#include "HitableList.h"
#include "ImageParam.h"
#include "Camera.h"
#include "Lambertian.h"
#include "Box.h"
#include "Medium.h"
#include "Rectangle.h"
#include "Triangle.h"
namespace RayTracer
{
	class BoxPrimitiveSample : public SampleBase
	{
	public:
		BoxPrimitiveSample() = default;
		~BoxPrimitiveSample() = default;

		void Init();
		void Render();
		void ImGui();
		void ShutDown();
	private:
		vec3 RayColor(const Ray& ray, const Hitable& world, int depth);
		vec3 RayColor(const Ray& r, const vec3& background, const Hitable& world, int depth);
	private:
		int curIndex;
		bool isGenerate;
		ImageParam mImageParam; // output image
		int samples_per_pixel = 10;
		int maxDepth = 10;
		bool isNormal = false;
		// scene
		HitableList world;
		std::shared_ptr<XZ_Rect> floor;
		std::shared_ptr<Hitable> box;
		std::shared_ptr<Triangle> tri;
		std::shared_ptr<Sphere> skybox;

		std::shared_ptr<Lambertian> floorMat;
		std::shared_ptr<Lambertian> boxMat;
		std::shared_ptr<Lambertian> triangleMat;
		// camera
		Camera camera;
		vec3 lookfrom;
		vec3 lookat;
		float fov;

		// sky color
		vec3 upColor;
		vec3 downColor;
		vec3 bgColor;
		vec3 groundColor;
		vec3 boxColor;
	
	};
}
#endif // !CORE_BOX_PRIMITIVE_SAMPLE_H
